package org.lxy.service.impl;


import cn.hutool.core.bean.BeanUtil;
import org.lxy.dao.UserInfoDao;
import org.lxy.domain.UserInfoEntity;
import org.lxy.service.UserInfoService;
import org.lxy.utils.PageUtils;
import org.lxy.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;



@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, UserInfoEntity> implements UserInfoService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<UserInfoEntity> page = this.page(
                new Query<UserInfoEntity>().getPage(params),
                new QueryWrapper<UserInfoEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<UserInfoEntity> queryList(UserInfoEntity userInfoEntity) {
        return listByMap(BeanUtil.beanToMap(userInfoEntity, Boolean.TRUE, Boolean.TRUE));
    }

}